package com.example.docmanagement.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.UUID;

/**
 * 用户列表查询请求参数
 */
@Data
@Schema(description = "用户查询请求参数")
public class UserQueryRequest {

    @Schema(description = "页码（从1开始）", example = "1", defaultValue = "1")
    private Integer page = 1;

    @Schema(description = "每页数量", example = "20", defaultValue = "20")
    private Integer pageSize = 20;

    @Schema(description = "模糊搜索关键字（用户名、邮箱、姓名）", example = "admin")
    private String keyword;

    @Schema(description = "用户状态", allowableValues = {"active", "inactive", "banned"})
    private String status;

    @Schema(description = "角色ID", example = "1")
    private Long roleId;

    @Schema(description = "邮箱是否已验证")
    private Boolean emailVerified;

    @Schema(description = "是否包含已删除用户", defaultValue = "false")
    private Boolean includeDeleted = false;

    @Schema(description = "创建时间起始", example = "2025-01-01T00:00:00")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdAtStart;

    @Schema(description = "创建时间结束", example = "2025-12-31T23:59:59")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdAtEnd;

    @Schema(description = "排序字段", example = "createdAt", allowableValues = {"createdAt", "updatedAt", "lastSignInAt", "signInCount"})
    private String sortBy = "createdAt";

    @Schema(description = "排序方向", example = "desc", allowableValues = {"asc", "desc"})
    private String sortOrder = "desc";
}


